from django.db import models
from django.contrib.auth.models import User
from .base_model import BaseModel

class UserProfile(BaseModel):
    """用户配置文件模型，存储用户的额外信息"""
    user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
    real_name = models.CharField(max_length=100, verbose_name='真实姓名')
    nickname = models.CharField(max_length=50, verbose_name='别名', blank=True)
    phone_number = models.CharField(max_length=20, verbose_name='电话号码', blank=True)
    
    def __str__(self):
        return f'{self.real_name}的配置文件'
    
    class Meta:
        verbose_name = '用户配置文件'
        verbose_name_plural = '用户配置文件'